home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 028a / managr02.zip / CONFIG.BAS < prev    next >
BASIC Source File  |  1991-12-09  |  5KB  |  213 lines

  1. start:
  2.  
  3. ' This is a routine for working with the CONFIG.SYS file.
  4.  
  5. cls
  6. print "                      View or Change Your CONFIG.SYS File
  7. print
  8. print
  9. input "On which drive is your CONFIG.SYS file";drive$
  10.  
  11. redrive:
  12. drive$=drive$+"\"
  13. if drive$="a:\" then file1$="a:\config.sys
  14. if drive$="A:\" then file1$="a:\config.sys
  15. if drive$="b:\" then file1$="b:\config.sys
  16. if drive$="B:\" then file1$="b:\config.sys
  17. if drive$="c:\" then file1$="c:\config.sys
  18. if drive$="C:\" then file1$="c:\config.sys
  19. if drive$="d:\" then file1$="d:\config.sys
  20. if drive$="D:\" then file1$="d:\config.sys
  21. if drive$="a:\" then file2$="a:\config.bak
  22. if drive$="A:\" then file2$="a:\config.bak
  23. if drive$="b:\" then file2$="b:\config.bak
  24. if drive$="B:\" then file2$="b:\config.bak
  25. if drive$="c:\" then file2$="c:\config.bak
  26. if drive$="C:\" then file2$="c:\config.bak
  27. if drive$="d:\" then file2$="d:\config.bak
  28. if drive$="D:\" then file2$="d:\config.bak
  29.  
  30. confmenu:
  31. cls
  32. print "You have the following options:"
  33. print
  34. print
  35. print "1- Just view the CONFIG.SYS file."
  36. print
  37. print "2- Add lines to the end of your file."
  38. print
  39. print "3- Create a new CONFIG.SYS file."
  40. print
  41. print "4- Return to the Main Options Menu."
  42. print
  43. print
  44. print
  45. input "Please press the number corresponding to your choice, and then press Enter. ",chngview$
  46.  
  47. if chngview$="1" then 
  48. cls
  49. gosub seesys
  50. goto confmenu
  51. end if
  52.  
  53. if chngview$="2" then 
  54. cls
  55. gosub appendln
  56. gosub seesys
  57. goto confmenu
  58. end if
  59.  
  60. if chngview$="3" then 
  61. cls
  62. goto newfilec
  63. end if
  64.  
  65. if chngview$="4" then goto finish
  66. goto confmenu
  67.  
  68.  
  69.  
  70. 'This section creates a new CONFIG.SYS file.
  71.  
  72. newfilec:
  73. cls
  74. open file1$ for input as 1
  75. open file2$ for output as 2
  76. while not eof(1)
  77. line input # 1, a$
  78. print# 2, a$
  79. wend
  80. close # 1
  81. close # 2
  82. kill file1$
  83. print
  84. print
  85. print "Your CONFIG.SYS file has been changed to CONFIG.BAK in order to save it for
  86. print "future use.  To use it later, it will have to be renamed to something else
  87. print "(for example, CONFIG.X)."
  88. print
  89. print
  90. print
  91. print "Press any key to continue. ";
  92. gosub presskey
  93.  
  94. changeagn:
  95. cls
  96. open file1$ for output as 1
  97. print "How many files do you want?
  98. input "To quit, press Q and Enter. ",filenumb$
  99. if filenumb$="q" or filenumb$="Q" then goto restorec
  100. print# 1, "files=";filenumb$
  101. print
  102. print
  103. print
  104. input "How many buffers do you want";buffer$
  105. print# 1, "buffers=";buffer$
  106.  
  107. devcagain:
  108. print
  109. input "Which device would you like to include (N for none)";device$
  110. if device$="n" or device$="N" then goto nodevice
  111. print# 1, "devices=";device$
  112. print
  113. input "Would you like to include more devices";incldmore$
  114. if incldmore$="y" or incldmore$="Y" then goto devcagain
  115.  
  116. nodevice:
  117. print
  118. input "Do you want Break on or off (if not sure, type OFF)";breakyn$
  119. if breakyn$="on" or breakyn$="ON" then print# 1, "break=on
  120. close # 1
  121. gosub seesys
  122. print
  123. print
  124. print
  125. print "If this is not O.K. AND you want to go back and change the file, press C and
  126. print "then press Enter."
  127. print
  128. print "To restore your original CONFIG.SYS file, press R and Enter.
  129. print
  130. input "If you're happy with it as is, type OK and Enter. ",change$
  131.  
  132. okdecide:
  133. if change$="c" or change$="C" then goto changeagn
  134. if change$="r" or change$="R" then goto restorec
  135. if change$="ok" or change$="OK" then goto confmenu
  136. print
  137. input "You must choose between C, R, or OK. ",change$:goto okdecide
  138.  
  139.  
  140. restorec:
  141. cls
  142. reset
  143. kill file1$
  144. open file2$ for input as 1
  145. open file1$ for output as 2
  146. while not eof(1)
  147. line input # 1, a$
  148. print# 2, a$
  149. wend
  150. reset
  151. print "Your original CONFIG.SYS file has been restored."
  152. print
  153. print
  154. print "Press any key to continue. ";
  155. gosub presskey
  156. goto confmenu
  157.  
  158. 'This is the end of the routine for working with the CONFIG.SYS file.
  159.  
  160.  
  161. ' Here is the routine for looking at the CONFIG.SYS file.
  162.  
  163. seesys:
  164. reset
  165. cls
  166. print "Here is your file:"
  167. print
  168. open file1$ for input as 1
  169. while not eof(1)
  170. line input # 1, a$
  171. print a$
  172. wend
  173. close # 1
  174. print
  175. print
  176. print "Press any key to continue. ";
  177. gosub presskey
  178. return
  179.  
  180. 'This is the end of the routine for looking at the CONFIG.SYS file.
  181.  
  182.  
  183.  
  184. 'Here is the routine for adding lines to the end of CONFIG.SYS.
  185.  
  186. appendln:
  187. reset
  188. open file1$ for append as 1
  189.  
  190. appendagn:
  191. print
  192. input "Line to add (Q to quit)";appendln$
  193. if appendln$="q" or appendln$="Q" then close # 1:return
  194. print# 1, appendln$
  195. goto appendagn
  196.  
  197. 'This is the end of the routine for adding lines to CONFIG.SYS.
  198.  
  199.  
  200. 'Here is the routine for continuing when the user presses a key.
  201.  
  202. presskey:
  203. wait:
  204. a$=inkey$
  205. if a$="" then goto wait
  206. return
  207.  
  208.  
  209. 'Here is the routine for ending the program.
  210.  
  211. finish:
  212. end
  213.